<%--
  Created by IntelliJ IDEA.
  User: Wing
  Date: 2020/8/24
  Time: 19:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link
	href="${pageContext.request.contextPath}/css/jquery.dataTables.min.css"
	type="text/css" rel="stylesheet" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/font-awesome.min.css">

<title>Title</title>
</head>
<body>
	<!-- 面板 -->
	<div class="panel panel-default">
		<!-- 面板头-->
		<input type="text" name="tname" /> <input type="button" value="查询"
			id="search" /> <a class="btn btn-info" id="add_btn">增加</a>

		<button type="button" float="right" class="btn btn-danger"
			id="tenancys_del_btn">批量删除</button>
	</div>
	<div style="width: 1000px; margin: 20px auto">
		<table
			class="table table-bordered table-striped table-hover table-condensed"
			style="width: 1000px; margin: 20px auto" id="tenancysTable">
			<thead>
				<tr>
					<th>全选</th>
					<th>房屋id(点击查看详情)</th>
					<th>租户id(点击查看详情)</th>
					<th>租赁编号</th>
					<th>租赁时间</th>
					<th>租赁时长</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody></tbody>
		</table>
	</div>
	<!-- 增加详情 -->
	<div class="modal fade" id="tenancyAddInfoModal" tabindex="-1"
		role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">增加详情</h4>
				</div>
				<div class="modal-body">
					<!--                 <p class="text-center"> 你好，这里是详情</p> -->
					<form class="form-horizontal" role="form" id="add_tenancy_form">
						<div class="form-group">

							<label for="h-id" class="col-sm-3 control-label">房屋id:</label>
							<div class="col-sm-9">
								<select id="addh-id" class="form-control" name="h_id">
								</select>

							</div>
						</div>
						<div class="form-group">

							<label for="t_id" class="col-sm-3 control-label">租户id:</label>
							<div class="col-sm-9">
								<input type="text" class="form-control" id="t_id"
									placeholder="请输入租户id" name="t_id">
							</div>
						</div>
						<div class="form-group">

							<label for="leaseFile_id" class="col-sm-3 control-label">租赁编号:</label>
							<div class="col-sm-9">
								<input type="text" class="form-control" id="leaseFile_id"
									placeholder="请输入租赁编号" name="leaseFile_id">
							</div>
						</div>
						<div class="form-group">

							<label for="leaseFile_date" class="col-sm-3 control-label">租赁时间:</label>
							<div class="col-sm-9">
								<input type="date" class="form-control" id="leaseFile_date"
									placeholder="请输入租赁时间" name="leaseFile_date">
							</div>
						</div>
						<div class="form-group">
							<label for="leaseFile_time" class="col-sm-3 control-label">租赁时长:</label>
							<div class="col-sm-9">
								<input type="text" class="form-control" id="leaseFile_time"
									placeholder="请输入租赁时长" name="leaseFile_time">
							</div>
						</div>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary" id="add_tenancy_btn">确定</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 增加详情结束 -->
	<!-- 房屋详情显示 -->
	<div class="modal fade" id="houseInfoModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myHouseModalLabel">房屋详情</h4>
				</div>
				<div class="modal-body">
					<p class="text-center" name="houseInfo"></p>
					<table id="houseInfoTable" class="table table-hover">
					<thead>
<!-- 				<tr> -->
<!-- 					<th>全选</th> -->
<!-- 					<th>房屋id</th> -->
<!-- 					<th>租户id</th> -->
<!-- 					<th>租赁编号</th> -->
<!-- 					<th>租赁时间</th> -->
<!-- 					<th>租赁时长</th> -->
<!-- 					<th>操作</th> -->
<!-- 				</tr> -->
			</thead>
						<tbody>
						
						</tbody>
					</table>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-success" data-dismiss="modal"
						formaction="">打印</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 房屋详情结束 -->
	<!-- 租户详情显示 -->
	<div class="modal fade" id="tenementInfoModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myTenementModalLabel">租户详情</h4>
				</div>
				<div class="modal-body">
				
					<table id="tenementInfoTable" class="table table-hover">
					<thead>
				
			</thead>
						<tbody>
						
						</tbody>
					</table>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary" data-dismiss="modal"
						id="">确定</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 租户详情结束 -->
	<!-- 修改模态框 -->
	<div class="modal fade" id="updateInfoModal" tabindex="-1"
		role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myupdateModalLabel">修改信息</h4>
				</div>
				<div class="modal-body">
					<p class="text-center">修改</p>
					<form class="form-horizontal" role="form" id="update_tenancy_form">
						<div class="form-group">

							<label for="rf_id" class="col-sm-3 control-label">租赁序号:</label>
							<div class="col-sm-9">
								<input type="text" readonly class="form-control" id="rf_id2"
									value="" name="rf_id">
							</div>
						</div>
						<div class="form-group">

							<label for="h_id" class="col-sm-3 control-label">房屋id:</label>
							<div class="col-sm-9">
								<select id="addh-id2" class="form-control" name="h_id">
								</select>
							</div>
						</div>
						<div class="form-group">

							<label for="t_id" class="col-sm-3 control-label">租户id:</label>
							<div class="col-sm-9">
								<input type="text" class="form-control" id="t_id2"
									placeholder="请输入租户id" name="t_id">
							</div>
						</div>
						<div class="form-group">

							<label for="leaseFile_id" class="col-sm-3 control-label">租赁编号:</label>
							<div class="col-sm-9">
								<input type="text" class="form-control" id="leaseFile_id2"
									placeholder="请输入租赁编号" name="leaseFile_id">
							</div>
						</div>
						<div class="form-group">

							<label for="leaseFile_date" class="col-sm-3 control-label">租赁时间:</label>
							<div class="col-sm-9">
								<input type="date" class="form-control" id="leaseFile_date2"
									placeholder="请输入租赁时间" value="" name="leaseFile_date">
							</div>
						</div>
						<div class="form-group">
							<label for="leaseFile_time" class="col-sm-3 control-label">租赁时长:</label>
							<div class="col-sm-9">
								<input type="text" class="form-control" id="leaseFile_time2"
									placeholder="请输入租赁时长" name="leaseFile_time">
							</div>
						</div>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary"
						id="updateTenancy_Info_btn">确定</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 修改结束 -->
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/js/jquery-1.12.3.min.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/js/jquery.dataTables.min.js"></script>
	<script type="text/javascript">
		//dataTable
		$(function() {
			// houseInfoDisplay();
			datatable();
			addTenancy();
			geth_idoptions();
			UpdateTenancyInfo();
			deleteTenancys();
			getH_idOptions();
		})

		function datatable() {

			$("#search").click(function() {

				var table = $('#tenancysTable').DataTable();

				table.ajax.reload();

			});

			$("#tenancysTable")
					.DataTable(
							{
								// 是否允许检索
								"searching" : false,

								// 初期排序列
								//"order": [[0,'asc'],[1,'desc']],
								// 是否显示情报 就是"当前显示1/100记录"这个信息
								"info" : true,
								// 是否允许翻页，设成false，翻页按钮不显示
								"paging" : true,

								// 件数选择功能 默认true
								"lengthChange" : true,
								// 件数选择下拉框内容
								"lengthMenu" : [ 5, 10, 15 ],
								// 每页的初期件数 用户可以操作lengthMenu上的值覆盖
								"pageLength" : 5,
								//翻页按钮样式
								// numbers:数字
								// simple:前一页，后一页
								// simple_numbers:前一页，后一页，数字
								// full:第一页，前一页，后一页，最后页
								//full_numbers:第一页，前一页，后一页，最后页，数字
								//first_last_numbers:第一页，最后页，数字
								"pagingType" : "full_numbers",
								// 行样式应用 指定多个的话，第一行tr的class为strip1，第二行为strip2，第三行为strip3.
								// 第四行以后又开始从strip1循环。。。 如果想指定成斑马条状，这里的class必须指定为2个。
								//  "stripeClasses": ['strip1', 'strip2'],
								// 自动列宽
								// "autoWidth": true,
								// 是否表示 "processing" 加载中的信息，这个信息可以修改
								"processing" : true,
								// 每次创建是否销毁以前的DataTable,默认false
								"destroy" : false,
								// 控制表格各种信息的表示位置（比较复杂） 默认:lfrtip
								// 具体参考：https://datatables.net/reference/option/dom
								//"dom": 'lrtip',
								"language" : {
									"processing" : "数据正在读取中",
									// 当前页显示多少条
									"lengthMenu" : "每页显示 _MENU_项",
									// _START_（当前页的第一条的序号） ,_END_（当前页的最后一条的序号）,_TOTAL_（筛选后的总件数）,
									// _MAX_(总件数),_PAGE_(当前页号),_PAGES_（总页数）
									"info" : "_PAGE_/_PAGES_ 共_TOTAL_",
									// 没有数据的显示（可选），如果没指定，会用zeroRecords的内容
									"emptyTable" : "无内容",

									// 千分位的符号，只对显示有效，默认就是","  一般不要改写
									//"thousands": "'",
									// 小数点位的符号，对输入解析有影响，默认就是"." 一般不要改写
									//"decimal": "-",
									// 翻页按钮文字控制
									"paginate" : {
										"first" : "首页",
										"last" : "尾页",
										"next" : "下一页",
										"previous" : "上一页"
									}

								},
								// 默认是false
								// 如果设为true，将只渲染当前也的html，速度会很快，但是通过API就访问不到所有页的数据，有利有弊
								//"deferRender": false,
								// 服务器端处理方式
								"serverSide" : true,

								// ajax选项 可以直接简单指定成请求的文件
								//"ajax": "data.json",
								// 也可以用对象来配置，更加灵活
								"ajax" : {
									// url可以直接指定远程的json文件，或是MVC的请求地址 /Controller/Action
									url : "${pageContext.request.contextPath}/tc/list",
									type : 'POST',
									// 传给服务器的数据，可以添加我们自己的查询参数
									data : function(param) {
										//param.opportunityNO = $('#txtSearch').val();
										//rolename是自己定义的，
										param.rolename = $(":text[name=tname]")
												.val();
										//param.***=$(":text[name=rname]").val();
										return param;
									},
								//用于处理服务器端返回的数据。 dataSrc是DataTable特有的
								/*dataSrc: function (myJson) {
								
								    alert(JSON.stringify(myJson));
								    return myJson.data;
								}*/
								},
								//指定用于行ID的属性名 默认是：DT_RowId
								"rowId" : 'rf_id',
								// 列定义
								"columns" : [ {
									"data" : ""
								}, {
									"data" : "house_id"
								}, {
									"data" : "tenement_id"
								}, {
									"data" : "leaseFile_id"
								}, {
									"data" : "leaseFile_date"
								}, {
									"data" : "leaseFile_time"
								}, {
									"data" : ""
								},
								//   { "data": ""},
								],
								columnDefs : [
										{
											targets : [ 6 ],
											render : function(data, type, row,
													meta) {
												// alert(row.id);

												return "<button class='btn btn-danger btn-xs' name='del_tenancy_btn'>删除</button>&nbsp<button class='btn btn-success btn-xs' name='update_tenancyInfo_btn'>修改</button>";
											}
										},

										{
											targets : [ 1 ],
											render : function(data, type, row,
													meta) {

												return "<p id='houseidd' name='houseidddd' value="+data+"  >"
														+ data + "</p>";
											}
										},
										{
											targets : [ 2 ],
											render : function(data, type, row,
													meta) {

												return "<p id='tenementidd' name='tenementidddd' value="+data+"  >"
														+ data + "</p>";
											}
										},
										{
											targets : [ 0 ],
											render : function(data, type, row,
													meta) {
												// alert(row.id);
												return "<input type=checkbox   value='"+row.rf_id+"' name='tenancyId'/>";
											}
										}

								]

							});
			//显示房屋信息
			$('#tenancysTable tbody')
					.on(
							'click',
							'tr  [name=houseidddd]',
							function(e) {
								var house_id = $(this).text();
								$
										.ajax({
											url : "${pageContext.request.contextPath}/tc/getHouseByhouse_id",
											type : "post",
											
											data : {
												"house_id" : house_id
											},
											error : function() {
												alert("获取房屋信息有误！！！");
											},
											success : function(data) {
												var houseInfo = JSON.parse(data);
												var infoList="";
									                    
									                    infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <p> 大小 </p>"+ houseInfo.house_area + " m²</td>";
									                    infoList = infoList + "</tr>";
									                    infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <p> 户型 </p>"+ houseInfo.house_shape + "</td>";
									                    infoList = infoList + "</tr>";
									                    infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <p> 楼层 </p>"+ houseInfo.house_floor + "</td>";
									                    infoList = infoList + "</tr>";
									                    infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <p> 状态 </p>"+ houseInfo.house_status + "</td>";
									                    infoList = infoList + "</tr>";
									                    infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <p> 朝向 </p>"+ houseInfo.house_structure + "</td>";
									                    infoList = infoList + "</tr>";
									                    infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <p> 交房时间 </p>"+ houseInfo.house_time + "</td>";
									                    infoList = infoList + "</tr>";
									                    if (houseInfo.house_assets) {
									                    	infoList = infoList + "<tr>";
										                    infoList = infoList + "<td> <p> 所属权 </p>"+ houseInfo.house_assets + "</td>";
										                    infoList = infoList + "</tr>";
														}else {
															infoList = infoList + "<tr>";
										                    infoList = infoList + "<td> <p> 所属权 </p>无</td>";
										                    infoList = infoList + "</tr>";
														}
									                    if (houseInfo.house_jurisdictionType) {
									                    	infoList = infoList + "<tr>";
										                    infoList = infoList + "<td> <p> 权 </p>"+ houseInfo.house_jurisdictionType + "</td>";
										                    infoList = infoList + "</tr>";
														} else {
															infoList = infoList + "<tr>";
										                    infoList = infoList + "<td> <p> 权 </p>无</td>";
										                    infoList = infoList + "</tr>";
														}
									                    
									                 if (houseInfo.house_jurisdictionNumber) {
									                	 infoList = infoList + "<tr>";
										                    infoList = infoList + "<td> <p> 权的编号 </p>"+ houseInfo.house_jurisdictionNumber + "</td>";
										                    infoList = infoList + "</tr>";
													}else {
														infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <p> 权的编号 </p>无</td>";
									                    infoList = infoList + "</tr>";
													}
									                    
									                    
									                    
									                    
									       
												$("#houseInfoTable tbody").html(
														infoList);
												$('#houseInfoModal').modal(
														'show');

											}
										})

							});
			//显示租户信息
			$('#tenancysTable tbody')
					.on(
							'click',
							'tr  [name=tenementidddd]',
							function(e) {
								var tenement_id = $(this).text();
								$
										.ajax({
											url : "${pageContext.request.contextPath}/tmc/getTenementBytenement_id",
											type : "post",
											
											data : {
												"tenement_id" : tenement_id
											},
											error : function() {
												alert("获取租户信息有误！！！");
											},
											success : function(data) {
												var tenementInfo = JSON.parse(data);
												var infoList="";
									                    
									                    infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <span> 租户姓名: </span>"+ tenementInfo.tenement_name + "</td>";
									                    infoList = infoList + "</tr>";
									                    infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <span> 租户年龄:</span>"+ tenementInfo.tenement_age + "岁</td>";
									                    infoList = infoList + "</tr>";
									                    infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <span> 租户电话:</span>"+ tenementInfo.tenement_phone + "</td>";
									                    infoList = infoList + "</tr>";
									                    infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <span> 紧急联系人姓名:</span>"+ tenementInfo.tenement_emergency_contact + "</td>";
									                    infoList = infoList + "</tr>";
									                    infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <span> 紧急联系人电话:</span>"+ tenementInfo.tenement_emergency_contact_phone + "</td>";
									                    infoList = infoList + "</tr>";

									       
												$("#tenementInfoTable tbody").html(
														infoList);
												$('#tenementInfoModal').modal(
														'show');

											}
										})

							});
			//给删除按钮加事件
			$('#tenancysTable tbody')
					.on(
							'click',
							'tr  [name=del_tenancy_btn]',
							function(e) {
								//得到所处行的id
								var rf_id = $(this).parents('tr')[0].id;
								$
										.ajax({
											url : "${pageContext.request.contextPath}/tc/deleteTenancyByid",
											type : "post",
											//dataType: "json",

											async : true,
											data : {
												"rf_id" : rf_id
											},
											error : function() {
												alert("删除有误！！！");
											},
											success : function(data) {
												alert(data);
												$('#tenancysTable').DataTable().ajax
														.reload();
											}
										})
							});

			//给修改按钮加事件，得到选择的id
			$('#tenancysTable tbody')
					.on(
							'click',
							'tr  [name=update_tenancyInfo_btn]',
							function(e) {
								// $("[name=update_tenancyInfo_btn]").click(function(){

								var rf_id = $(this).parents('tr')[0].id;

								$
										.ajax({
											url : "${pageContext.request.contextPath}/tc/getHouseId",
											type : "post",

											error : function() {
												alert("获取房屋信息有误！！！");
											},
											success : function(data) {
												// console.log(data);
												var array = JSON.parse(data);
												// console.log(array);
												if (array.length > 0) {
													for (var i = 0; i < array.length; i++) {
														var vid = array[i].h_id;
														var $optionItem = $("<option ></option>");
														$optionItem.attr(
																"value", vid);
														$optionItem.text(vid);
														$("#addh-id2").append(
																$optionItem);

													}
												}
												//$("#addh-id");
												//
												//$optionItem.attr("value",);

											}

										});

								$
										.ajax({
											url : "${pageContext.request.contextPath}/tc/getUpdateTenancyInfo",
											type : "post",
											async : true,
											dataType : "json",
											data : {
												"rf_id" : rf_id
											},
											error : function() {
												alert("修改" + rf_id + "有误")
											},
											success : function(data) {
												//alert(data);
												$("#rf_id2").val(data.rf_id);
												$("#t_id2").val(data.t_id);
												$("#h_id2").val(data.h_id);
												$("#leaseFile_id2").val(
														data.leaseFile_id);
												$("#leaseFile_date2").val(
														data.leaseFile_date);
												$("#leaseFile_time2").val(
														data.leaseFile_time);
												$("#time2").val(data.time);
												$('#updateInfoModal').modal(
														'show');
											}
										})

							});

		}

		//修改
		function UpdateTenancyInfo() {
			$("#updateTenancy_Info_btn")
					.click(
							function() {

								$
										.ajax({
											url : "${pageContext.request.contextPath}/tc/UpdateTenancyInfo",
											type : "post",
											async : true,
											data : $("#update_tenancy_form")
													.serialize(),
											error : function() {
												alert("修改失败！！！");
											},
											success : function(data) {
												alert(data);
												//隐藏模态框
												$('#updateInfoModal').modal(
														'hide');
												$('#tenancysTable').DataTable().ajax
														.reload();
											}
										})
							});
		}

		function deleteTenancys() {
			//给批量删除按钮加事件，得到选择的id
			$('#tenancys_del_btn')
					.click(
							function() {
								$(":checkbox[name=tenancyId]:checked")
										.each(
												function() {

													//   alert($(this).val())
													var rf_ids = [];
													$(
															":checkbox[name=tenancyId]:checked")
															.each(
																	function() {
																		rf_ids
																				.push($(
																						this)
																						.val());
																	});

													if (rf_ids == "") {
														alert("请至少选择一个");
														return;
													}
													if (!confirm("是否要删除"
															+ rf_ids + "?")) {
														return;
													}

													$
															.ajax({
																url : "${pageContext.request.contextPath}/tc/deleteRegisterbooksById",
																type : "post",
																//dataType: "json",

																async : true,
																data : {
																	"rf_ids" : rf_ids
																			.join(",")
																},
																error : function() {
																	alert("删除有误！！！");
																},
																success : function(
																		data) {
																	alert(data);

																}
															});

												});
								$('#tenancysTable').DataTable().ajax.reload();

							});
		}
		//获取增加房屋信息
		function getH_idOptions() {
			$.ajax({
				url : "${pageContext.request.contextPath}/tc/getHouseId",
				type : "post",

				error : function() {
					alert("获取房屋信息有误！！！");
				},
				success : function(data) {
					// console.log(data);
					var array = JSON.parse(data);
					// console.log(array);
					if (array.length > 0) {
						for (var i = 0; i < array.length; i++) {
							var vid = array[i].h_id;
							var $optionItem = $("<option></option>");
							$optionItem.attr("value", vid);
							$optionItem.text(vid);
							$("#addh-id").append($optionItem);

						}
					}
					//$("#addh-id");
					//
					//$optionItem.attr("value",);

				}

			})

		}
		function geth_idoptions() {
			$("#add_btn").click(function() {
				$('#tenancyAddInfoModal').modal('show');

			})
		}
		//添加
		function addTenancy() {
			$("#add_tenancy_btn").click(function() {
				$.ajax({
					url : "${pageContext.request.contextPath}/tc/addTenancy",
					type : "post",
					data : $("#add_tenancy_form").serialize(),
					error : function() {
						alert("增加信息有误！！！");
					},
					success : function(data) {
						alert("增加成功！！！");
						$('#tenancyAddInfoModal').modal('hide');
						$("#t_id").val("");
						$("#h_id").val("");
						$("#leaseFile_id").val("");
						$("#leaseFile_date").val("");
						$("#leaseFile_time").val("");
						$("#time").val("");
						$('#tenancysTable').DataTable().ajax.reload();
					}
				})
			})

		}
	</script>
</body>
</html>
